<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<script src="https://cdn.bootcss.com/js-polyfills/0.1.42/polyfill.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/color-thief/2.3.0/color-thief.umd.js"></script>
		<script src="https://cdn.bootcss.com/hls.js/8.0.0-beta.3/hls.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
		<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>
		<style type="text/css">
			*{background: none;
				margin: 0;
				padding: 0;
				box-sizing: border-box;
				overflow: hidden;
				border: none;}
		</style>
		<script type="text/javascript">
			var $$_ = (function() {
				var url = window.document.location.href.toString(); 
				var u = url.split("?");
				if (typeof(u[1]) == "string") {
					u = u[1].split("&");
					var get = {};
					for (var i in u) {
						var j = u[i].split("=");
						get[j[0]] = j[1];
					}
					return get;
				} else {
					return {};
				}
			})();
			var getConfigs = {
				"id": $$_['id'] || '2844270533',
				"server": $$_['server'] || 'netease',
				"type": $$_['type'] || 'playlist',
				"auto": $$_['auto'] || 'true',
				"fixed": $$_['fixed'] || 'false',
				"mini": $$_['mini'] || 'false',
				"autoplay": $$_['autoplay'] || 'false',
				"theme": $$_['theme'] || '#2980b9',
				"loop": $$_['loop'] || 'all',
				"order": $$_['order'] || 'list',
				"preload": $$_['preload'] || 'auto',
				"volume": $$_['volume'] || '0.7',
				"mutex": $$_['mutex'] || 'true',
				"lrc-type": $$_['lrc-type'] || '0',
				"list-folded": $$_['list-folded'] || 'false',
				"list-max-height": $$_['list-max-height'] || '340px',
				"storage-name": $$_['storage-name'] || 'cosher-player',
			}
			console.clear()
			console.warn(`
			
Aplayer iframe 插件版
第三方插件引用：
		Aplayer		Meting		hls		polyfill
		
								URL参数列表
英文版:
------------------------------------------------------------------------------------------------------------------------------------------------------------
|参数			|默认值		|其他值																															|
|option			|default	|description																													|
|id				|require	|song id / playlist id / album id / search keyword																				|
|server			|require	|music platform: netease, tencent, kugou, xiami, baidu																			|
|type			|require	|song, playlist, album, search, artist																							|
|auto			|options	|music link, support: netease, tencent, xiami																					|
|fixed			|FALSE		|enable fixed mode																												|
|mini			|FALSE		|enable mini mode																												|
|autoplay		|FALSE		|audio autoplay																													|
|theme			|#2980b9	|main color																														|
|loop			|all		|player loop play, values: 'all', 'one', 'none'																					|
|order			|list		|player play order, values: 'list', 'random'																					|
|preload		|auto		|values: 'none', 'metadata', 'auto'																								|
|volume			|0.7		|default volume, notice that player will remember user setting, default volume will not work after user set volume themselves	|
|mutex			|TRUE		|prevent to play multiple player at the same time, pause other players when this player start play								|
|lrc-type		|0			|lyric type																														|
|list-folded	|FALSE		|indicate whether list should folded at first																					|
|list-max-height|340px		|list max height																												|
|storage-name	|metingjs	|localStorage key that store player setting																						|
-------------------------------------------------------------------------------------------------------------------------------------------------------------
中文版：

|名称			|默认值								|描述																	|
|container		|document.querySelector('.aplayer')	|播放器容器元素															|
|fixed			|FALSE								|开启吸底模式, 详情														|
|mini			|FALSE								|开启迷你模式, 详情														|
|autoplay		|FALSE								|音频自动播放																|
|theme			|'#b7daff'							|主题色																	|
|loop			|'all'								|音频循环播放, 可选值: 'all', 'one', 'none'								|
|order			|'list'								|音频循环顺序, 可选值: 'list', 'random'									|
|preload		|'auto'								|预加载，可选值: 'none', 'metadata', 'auto'								|
|volume			|0.7								|默认音量，请注意播放器会记忆用户设置，用户手动设置音量后默认音量即失效			|
|audio			|-									|音频信息, 应该是一个对象或对象数组											|
|audio.name		|-									|音频名称																|
|audio.artist	|-									|音频艺术家																|
|audio.url		|-									|音频链接																|
|audio.cover	|-									|音频封面																|
|audio.lrc		|-									|详情																	|
|audio.theme	|-									|切换到此音频时的主题色，比上面的 theme 优先级高								|
|audio.type		|'auto'								|可选值: 'auto', 'hls', 'normal' 或其他自定义类型, 详情					|
|customAudioType|-									|自定义类型，详情															|
|mutex			|TRUE								|互斥，阻止多个播放器同时播放，当前播放器播放时暂停其他播放器					|
|lrcType		|0									|详情																	|
|listFolded		|FALSE								|列表默认折叠																|
|listMaxHeight	|-									|列表最大高度																|
|storageName	|'aplayer-setting'					|存储播放器设置的 localStorage key										|

BSD 3-Clause License
E-mail：813141818@qq.com
Copyright (c) 2020, 醉梦
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------------
			`);

		</script>
	</head>
	<body>
		<div id="app">
		</div>
		<script type="text/javascript">
			var musicPlayer=document.createElement("meting-js")
			for (k in getConfigs) {
				musicPlayer.setAttribute(k,getConfigs[k])
			}
			document.getElementById('app').appendChild(musicPlayer)
		</script>
	</body>
</html>
